﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ZzgkChatRoom.View;

namespace ZzgkChatRoom
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class LoginWindow : Window
    {

        LoginPage loginPage;
        NetworkPage networkPage;

        public LoginWindow()
        {
            InitializeComponent();
            loginPage = new LoginPage();
            frame.Navigate(loginPage);
        }

        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                 this.DragMove();
            }
        }

        private void CheckBox_Checked(object sender, RoutedEventArgs e)
        {
            if (networkPage==null) {
                networkPage = new NetworkPage();
            }
            frame.RemoveBackEntry();
            frame.Navigate(networkPage);
            
            //User_header.Visibility = Visibility.Collapsed;
            //login_btn.Visibility = Visibility.Collapsed;
        }

        private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            frame.RemoveBackEntry();
            frame.Navigate(loginPage);
            
        }
    }
}